package com.android.base.application;

import android.app.Application;
import android.content.Context;

import com.android.base.common.AppHandle;
import com.android.base.entity.AppInfo;

/**
 * baseapplication
 * Created by YANGQIYUN on 2016/12/9.
 */

public abstract class BaseApplication extends Application {
    //手机信息
    public static AppInfo info;
    //操作手柄
    public static AppHandle mAppHandle;

    @Override
    public void onCreate() {
        super.onCreate();
        //初始化配置
        initConfigure();

        init();
    }

    //初始化配置
    private void initConfigure() {
        info = new AppInfo();
        info.init(this);
        mAppHandle = new AppHandle();
        mAppHandle.init(this);
    }

    // 获取ApplicationContext
    public static Context getContext() {
        return info.getApplication();
    }

    public abstract void init();
}
